package com.gupaoedu.design.delegate.leader;

import java.util.HashMap;
import java.util.Map;

/**
 * <p></p>
 *
 * @author Andy
 * @date 2018/3/15.
 */
public class Leader implements ITarget {
    private Map<String, ITarget> initParam = new HashMap<String, ITarget>();

    public Leader() {
        init();
    }

    protected void init() {
        initParam.put("加密", new TargetA());
        initParam.put("并发", new TargetB());
    }

    public void doing(String command) {
        System.out.println("项目经理正在工作...");
        if (initParam.containsKey(command)) {
            initParam.get(command).doing(command);
        } else {
            System.out.println("现在人手不够，暂时需要搁置下。");
        }
    }
}
